from BSTestRunner import BSTestRunner
import unittest
import time
test_dir=r'../test_case'
discover=unittest.defaultTestLoader.discover(test_dir,pattern='test*.py')

# 拼装报告文件
report_dir='../reports'
now=time.strftime('%Y_%m_%d_%H_%M_%S')
report_name=rf'{report_dir}/{now}.html'
with open(report_name,'wb') as f:
    runner=BSTestRunner(f,title='测试报告',description='测试详情')
    runner.run(discover)